<template>
  <div>
    <h2>{{ titleName }}</h2>
    <!-- 传参给使用者，以前是给组件传参 -->
    <slot :foods="foods">aaa</slot>
  </div>
</template>

<script>
export default {
  props: ["dataList", "titleName"],
  data: function () {
    return {
      foods: ["饺子", "拉面", "炒饭"],
    };
  },
};
</script>

<style scoped>
div {
  background-color: orange;
  width: 200px;
  text-align: center;
}
</style>